I had some vacation time to use and decided to get my hands dirty with some machine learning projects while I was off. It’s always been something I’ve studied, as the tech developed. For the longest time it seemed nested in the mysterious papers behind academic doors. Along came ChatGPT and the rest was history.
As I’ve witnessed tech wave after tech wave come, I feel like I’ve gotten a rough sense of how these things go. The tech is always life changing, but not in the way the hype machine seems to promise. Everyone's gaze turns to the “one off,” enormous changes that take over like a tidal wave, and we lose sight of the small, almost non-descript changes that take place in the background. The most influential technology is always in the small refined applications in the background.
That is my feeling with AI. There isn’t a single pot of gold to be had, but a scattering of infinite use cases. In that sense, I wanted to tackle a project that gave me insight in how to train my own model. I wanted to go through the process of collecting the data and learn how to best organize it. I mostly wanted to know if you lose proprietary control in any of the stages.
I began with the FastAI course. The course is a good one and easy to follow along. The project I created was fine-tuning a ResNet18 model with images so it could tell the difference between an HDMI cable and a VGA cable.I know there’s no practical use for it, but it provided the path of collecting data and training that I wanted to study. I was also convinced it would be an easy enough task to complete before going back to work. What I quickly learned, is what I always seem to learn when it comes to using data…It’s always all about the data. I gathered approximately 1000 images of VGA and HDMI cables and started the process outlined in the tutorials.
What I should have anticipated was that the data would be full of images of VGA to HDMI adapters. This meant I was training it on both images. This would be like teaching someone the difference between an American football and an English football and throwing in lots of images of rugby balls in both categories. To solve this I decided it needed four categories of classification.
-HDMI
-VGA
-HDMI and VGA
-Neither
What I thought was a modest collection of data, then became a huge pile of images I had to go through, one by one, and determine how they should be classified for training. I had to pull out every image of both and place them in it’s own directory. This was very tedious and not something I anticipated. The lesson learned was “respect the data.”
Once I had it sorted it out, the training process was also fascinating. I saw that my model was having trouble with some interesting images. For example, it was sure this was a VGA.
At first I was a bit heartbroken and blamed my poor patience with the data, but if you try to “think like a computer” you can see how it might be looking at the similar pyramid shape and how the stair steps could be seen as out of focus VGA pins.
Ultimately, I was able to train it to get it around 85% accurate. I’m sure I could have done better, but it was my vacation and I was spending it staring at VGA connections. I have it posted here on HuggingFace (a site for hosting your fine tuned models with a graphic interface)
Direct link: https://odonnell-abu-vga-or-hdmi.hf.space
So…if you ever have lots of these cable photos and want to know if any of them are VGA or HDMI….or Both! give it a spin. Just a quick note, if the site hasn't been active for a while it goes to sleep. It may take a minute to boot up. That is why I've included a direct link as well as the Iframe example.
Links:
Copyright © Brendan All Rights Reserved